#include "gtest/gtest.h"
#include <iostream>
#include <sstream>
#include "Board.h"

struct FtBoard : testing::Test
{

protected:
    void check(const char* expect)
    {
        ASSERT_TRUE(isEq(expect));
    }
    Board board;

private:
    bool isEq(const char* right)
    {
        std::ostringstream ss;
        // board.output(ss);

        const char*  left = ss.str().c_str();

        int offset = 0;
        for(int i = 0; i<4*4 ; i++)
        {
            if(left[(i+offset)] == '\n') offset++;//filter the \n
            if(left[(i+offset)] != right [i])
                return false;
        }
        return true;
    }
};

TEST_F(FtBoard, should_get_sec_board_when_give_init_borad)
{
    const char init_board[] =
    {  '0', '0' , '0','0'
       ,'0','b','w','0'
       ,'0','w','b','0'
       ,'0', '0' , '0' ,'0'
    };
    board.init(init_board);
    board.evolve(std::cout);
}

